package routers

import (
	"github.com/gin-gonic/gin"
	"modbus-go-demo/controller/api"
	"modbus-go-demo/middleware"
)

func ApiRouterInit(r *gin.Engine) {
	apiRouters := r.Group("/api")
	apiRouters.Use(middleware.CheckApiLogin).Use(Cors())
	// 设置中间件
	{
		apiRouters.Any("/info", api.HomeController{}.Info)
		apiRouters.Any("/test", api.HomeController{}.Test)
	}
}
